package com.service.impl;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jdbc.core.RowMapper;

import com.dao.UniversalDao;
import com.service.UniversalManager;

public class UniversalManagerImpl implements UniversalManager {

	protected final Log log = LogFactory.getLog(getClass());

	protected UniversalDao universalDao;
	
	public UniversalDao getUniversalDao() {
		return universalDao;
	}

	public void setUniversalDao(UniversalDao universalDao) {
		this.universalDao = universalDao;
	}

	@Override
	public void delete(Object o) {
		universalDao.delete(o);
	}

	@Override
	public void deleteAll(Collection entities) {
		// TODO Auto-generated method stub
		universalDao.deleteAll(entities);
	}

	@Override
	public List findAll(Class clazz) {
		return universalDao.findAll(clazz);
	}

	@Override
	public Object findByID(Class clazz, Serializable id) {
		return universalDao.findByID(clazz, id);
	}

	@Override
	public void insert(Object o) {
		universalDao.insert(o);
	}

	@Override
	public void update(Object o) {
		universalDao.update(o);
	}

	@Override
	public boolean execute(String sql) {
		return universalDao.execute(sql);
	}

	@Override
	public List queryForList(String sql) {
		return universalDao.queryForList(sql);
	}

	@Override
	public List queryForList(String sql, Object[] args) {
		return universalDao.queryForList(sql, args);
	}

	@Override
	public Map queryForMap(String sql) {
		return universalDao.queryForMap(sql);
	}

	@Override
	public Object queryForObject(String sql, RowMapper rowMapper) {
		return universalDao.queryForObject(sql, rowMapper);
	}

	
}
